package com.animation;

public class CalculateValue {

	public enum ECurveType {
		Linear, InQuad, OutQuad, InOutQuad, OutInQuad, InCubic, OutCubic, InOutCubic, OutInCubic, InQuart, OutQuart, InOutQuart, OutInQuart, InQuint, OutQuint, InOutQuint, OutInQuint, InSine, OutSine, InOutSine, OutInSine, InExpo, OutExpo, InOutExpo, OutInExpo, InCirc, OutCirc, InOutCirc, OutInCirc, InElastic, OutElastic, InOutElastic, OutInElastic, InBack, OutBack, InOutBack, OutInBack, OutBounce, InBounce, InOutBounce, OutInBounce, InCurve, OutCurve, SineCurve, CosineCurve
	};

	static final double M_PI_2 = Math.PI / 2.0;

	static double easeInQuad(double t) {
		return t * t;
	}

	static double easeOutQuad(double t) {
		return -t * (t - 2.0);
	}

	static double easeInOutQuad(double t) {
		t *= 2.0;
		if (t < 1.0) {
			return t * t / 2.0;
		} else {
			--t;
			return -0.5 * (t * (t - 2.0) - 1.0);
		}
	}

	static double easeOutInQuad(double t) {
		if (t < 0.5)
			return easeOutQuad(t * 2.0) / 2.0;
		return easeInQuad((2.0 * t) - 1.0) / 2.0 + 0.5;
	}

	static double easeInCubic(double t) {
		return t * t * t;
	}

	static double easeOutCubic(double t) {
		t -= 1.0;
		return t * t * t + 1.0;
	}

	/**
	 * Easing equation function for a cubic (t^3) easing out/in: deceleration
	 * until halfway, then acceleration.
	 * 
	 * @param t
	 *            Current time (in frames or seconds).
	 * @return The correct value.
	 */
	static double easeOutInCubic(double t) {
		if (t < 0.5)
			return easeOutCubic(2.0 * t) / 2.0;
		return easeInCubic(2.0 * t - 1.0) / 2.0 + 0.5;
	}

	/**
	 * Easing equation function for a quartic (t^4) easing in: accelerating from
	 * zero velocity.
	 * 
	 * @param t
	 *            Current time (in frames or seconds).
	 * @return The correct value.
	 */
	static double easeInQuart(double t) {
		return t * t * t * t;
	}

	/**
	 * Easing equation function for a quartic (t^4) easing out: decelerating
	 * from zero velocity.
	 * 
	 * @param t
	 *            Current time (in frames or seconds).
	 * @return The correct value.
	 */
	static double easeOutQuart(double t) {
		t -= 1.0;
		return -(t * t * t * t - 1.0);
	}

	/**
	 * Easing equation function for a quartic (t^4) easing in/out: acceleration
	 * until halfway, then deceleration.
	 * 
	 * @param t
	 *            Current time (in frames or seconds).
	 * @return The correct value.
	 */
	static double easeInOutQuart(double t) {
		t *= 2.0;
		if (t < 1.0)
			return 0.5 * t * t * t * t;
		else {
			t -= 2.0;
			return -0.5 * (t * t * t * t - 2.0);
		}
	}

	/**
	 * Easing equation function for a quartic (t^4) easing out/in: deceleration
	 * until halfway, then acceleration.
	 * 
	 * @param t
	 *            Current time (in frames or seconds).
	 * @return The correct value.
	 */
	static double easeOutInQuart(double t) {
		if (t < 0.5)
			return easeOutQuart(2.0 * t) / 2.0;
		return easeInQuart(2.0 * t - 1.0) / 2.0 + 0.5;
	}

	/**
	 * Easing equation function for a quintic (t^5) easing in: accelerating from
	 * zero velocity.
	 * 
	 * @param t
	 *            Current time (in frames or seconds).
	 * @return The correct value.
	 */
	static double easeInQuint(double t) {
		return t * t * t * t * t;
	}

	/**
	 * Easing equation function for a quintic (t^5) easing out: decelerating
	 * from zero velocity.
	 * 
	 * @param t
	 *            Current time (in frames or seconds).
	 * @return The correct value.
	 */
	static double easeOutQuint(double t) {
		t -= 1.0;
		return t * t * t * t * t + 1.0;
	}

	/**
	 * Easing equation function for a quintic (t^5) easing in/out: acceleration
	 * until halfway, then deceleration.
	 * 
	 * @param t
	 *            Current time (in frames or seconds).
	 * @return The correct value.
	 */
	static double easeInOutQuint(double t) {
		t *= 2.0;
		if (t < 1.0)
			return 0.5 * t * t * t * t * t;
		else {
			t -= 2.0;
			return 0.5 * (t * t * t * t * t + 2.0);
		}
	}

	/**
	 * Easing equation function for a quintic (t^5) easing out/in: deceleration
	 * until halfway, then acceleration.
	 * 
	 * @param t
	 *            Current time (in frames or seconds).
	 * @return The correct value.
	 */
	static double easeOutInQuint(double t) {
		if (t < 0.5)
			return easeOutQuint(2.0 * t) / 2.0;
		return easeInQuint(2.0 * t - 1.0) / 2.0 + 0.5;
	}

	/**
	 * Easing equation function for a sinusoidal (sin(t)) easing in:
	 * accelerating from zero velocity.
	 * 
	 * @param t
	 *            Current time (in frames or seconds).
	 * @return The correct value.
	 */
	static double easeInSine(double t) {
		return (t == 1.0) ? 1.0 : -Math.cos(t * M_PI_2) + 1.0;
	}

	/**
	 * Easing equation function for a sinusoidal (sin(t)) easing out:
	 * decelerating from zero velocity.
	 * 
	 * @param t
	 *            Current time (in frames or seconds).
	 * @return The correct value.
	 */
	static double easeOutSine(double t) {
		return Math.sin(t * M_PI_2);
	}

	/**
	 * Easing equation function for a sinusoidal (sin(t)) easing in/out:
	 * acceleration until halfway, then deceleration.
	 * 
	 * @param t
	 *            Current time (in frames or seconds).
	 * @return The correct value.
	 */
	static double easeInOutSine(double t) {
		return -0.5 * (Math.cos(Math.PI * t) - 1.0);
	}

	/**
	 * Easing equation function for a sinusoidal (sin(t)) easing out/in:
	 * deceleration until halfway, then acceleration.
	 * 
	 * @param t
	 *            Current time (in frames or seconds).
	 * @return The correct value.
	 */
	static double easeOutInSine(double t) {
		if (t < 0.5)
			return easeOutSine(2.0 * t) / 2.0;
		return easeInSine(2.0 * t - 1.0) / 2.0 + 0.5;
	}

	/**
	 * Easing equation function for an exponential (2^t) easing in: accelerating
	 * from zero velocity.
	 * 
	 * @param t
	 *            Current time (in frames or seconds).
	 * @return The correct value.
	 */
	static double easeInExpo(double t) {
		return (t == 0.0 || t == 1.0) ? t
				: Math.pow(2.0, 10.0 * (t - 1.0)) - (0.001);
	}

	/**
	 * Easing equation function for an exponential (2^t) easing out:
	 * decelerating from zero velocity.
	 * 
	 * @param t
	 *            Current time (in frames or seconds).
	 * @return The correct value.
	 */
	static double easeOutExpo(double t) {
		return (t == 1.0) ? 1.0 : 1.001 * (-Math.pow(2.0, -10.0 * t) + 1.0);
	}

	/**
	 * Easing equation function for an exponential (2^t) easing in/out:
	 * acceleration until halfway, then deceleration.
	 * 
	 * @param t
	 *            Current time (in frames or seconds).
	 * @return The correct value.
	 */
	static double easeInOutExpo(double t) {
		if (t == 0.0)
			return 0;
		if (t == 1.0)
			return 1.0;
		t *= 2.0;
		if (t < 1.0)
			return 0.5 * Math.pow(2.0, 10.0 * (t - 1)) - 0.0005;
		return 0.5 * 1.0005 * (-Math.pow(2.0, -10.0 * (t - 1)) + 2.0);
	}

	/**
	 * Easing equation function for an exponential (2^t) easing out/in:
	 * deceleration until halfway, then acceleration.
	 * 
	 * @param t
	 *            Current time (in frames or seconds).
	 * @return The correct value.
	 */
	static double easeOutInExpo(double t) {
		if (t < 0.5)
			return easeOutExpo(2.0 * t) / 2.0;
		return easeInExpo(2.0 * t - 1.0) / 2.0 + 0.5;
	}

	/**
	 * Easing equation function for a circular (sqrt(1-t^2)) easing in:
	 * accelerating from zero velocity.
	 * 
	 * @param t
	 *            Current time (in frames or seconds).
	 * @return The correct value.
	 */
	static double easeInCirc(double t) {
		return -(Math.sqrt(1.0 - t * t) - 1.0);
	}

	/**
	 * Easing equation function for a circular (sqrt(1-t^2)) easing out:
	 * decelerating from zero velocity.
	 * 
	 * @param t
	 *            Current time (in frames or seconds).
	 * @return The correct value.
	 */
	static double easeOutCirc(double t) {
		t -= 1.0;
		return Math.sqrt(1.0 - t * t);
	}

	/**
	 * Easing equation function for a circular (sqrt(1-t^2)) easing in/out:
	 * acceleration until halfway, then deceleration.
	 * 
	 * @param t
	 *            Current time (in frames or seconds).
	 * @return The correct value.
	 */
	static double easeInOutCirc(double t) {
		t *= 2.0;
		if (t < 1.0) {
			return -0.5 * (Math.sqrt(1.0 - t * t) - 1.0);
		} else {
			t -= (2.0);
			return 0.5 * (Math.sqrt(1.0 - t * t) + 1.0);
		}
	}

	/**
	 * Easing equation function for a circular (sqrt(1-t^2)) easing out/in:
	 * deceleration until halfway, then acceleration.
	 * 
	 * @param t
	 *            Current time (in frames or seconds).
	 * @return The correct value.
	 */
	static double easeOutInCirc(double t) {
		if (t < 0.5)
			return easeOutCirc(2.0 * t) / 2.0;
		return easeInCirc(2.0 * t - 1.0) / 2.0 + 0.5;
	}

	static double easeInElastic_helper(double t, double b, double c, double d,
			double a, double p) {
		if (t == 0)
			return b;
		double t_adj = t / d;
		if (t_adj == 1)
			return b + c;

		double s;
		if (a < Math.abs(c)) {
			a = c;
			s = p / 4.0;
		} else {
			s = p / (2.0 * Math.PI) * Math.asin(c / a);
		}

		t_adj -= (1.0);
		return -(a * Math.pow(2.0, 10.0 * t_adj) * Math.sin((t_adj * d - s)
				* (2.0 * Math.PI) / p))
				+ b;
	}

	/**
	 * Easing equation function for an elastic (exponentially decaying sine
	 * wave) easing in: accelerating from zero velocity.
	 * 
	 * @param t
	 *            Current time (in frames or seconds).
	 * @param a
	 *            Amplitude.
	 * @param p
	 *            Period.
	 * @return The correct value.
	 */
	static double easeInElastic(double t, double a, double p) {
		return easeInElastic_helper(t, 0.0, 1.0, 1.0, a, p);
	}

	static double easeInElastic(double t) {
		return easeInElastic_helper(t, 0.0, 1.0, 1.0, 1, 0.3);
	}

	static double easeOutElastic_helper(double t, double b, double c, double d,
			double a, double p) {
		if (t == 0.0)
			return 0.0;
		if (t == 1.0)
			return c;

		double s;
		if (a < c) {
			a = c;
			s = p / 4.0;
		} else {
			s = p / 2.0 * Math.PI * Math.asin(c / a);
		}

		return (a * Math.pow(2.0, -10.0 * t)
				* Math.sin((t - s) * (2.0 * Math.PI) / p) + c);
	}

	/**
	 * Easing equation function for an elastic (exponentially decaying sine
	 * wave) easing out: decelerating from zero velocity.
	 * 
	 * @param t
	 *            Current time (in frames or seconds).
	 * @param a
	 *            Amplitude.
	 * @param p
	 *            Period.
	 * @return The correct value.
	 */
	static double easeOutElastic(double t, double a, double p) {
		return easeOutElastic_helper(t, 0.0, 1.0, 1.0, a, p);
	}

	static double easeOutElastic(double t) {
		return easeOutElastic_helper(t, 0.0, 1.0, 1.0, 1.0, 0.3);
	}

	/**
	 * Easing equation function for an elastic (exponentially decaying sine
	 * wave) easing in/out: acceleration until halfway, then deceleration.
	 * 
	 * @param t
	 *            Current time (in frames or seconds).
	 * @param a
	 *            Amplitude.
	 * @param p
	 *            Period.
	 * @return The correct value.
	 */
	static double easeInOutElastic(double t) {
		double a = 1.0;
		double p = 0.3;
		if (t == 0.0)
			return 0.0;
		t *= 2.0;
		if (t == 2.0)
			return 1.0;

		double s;
		if (a < 1.0) {
			a = 1.0;
			s = p / 4.0;
		} else {
			s = p / 2.0 * Math.PI * Math.asin(1.0 / a);
		}

		if (t < 1.0)
			return -.5
					* (a * Math.pow(2.0, 10.0 * (t - 1.0))
							* Math.sin(t - 1.0 - s) * (2.0 * Math.PI) / p);
		return a * Math.pow(2.0, -10.0 * (t - 1.0))
				* Math.sin((t - 1.0 - s) * (2.0 * Math.PI) / p) * 0.5 + 1.0;
	}

	/**
	 * Easing equation function for an elastic (exponentially decaying sine
	 * wave) easing out/in: deceleration until halfway, then acceleration.
	 * 
	 * @param t
	 *            Current time (in frames or seconds).
	 * @param a
	 *            Amplitude.
	 * @param p
	 *            Period.
	 * @return The correct value.
	 */
	static double easeOutInElastic(double t) {
		double a = 1.0;
		double p = 0.3;
		if (t < 0.5)
			return easeOutElastic_helper(t * 2.0, 0.0, 0.5, 1.0, a, p);
		return easeInElastic_helper(2.0 * t - 1.0, 0.5, 0.5, 1.0, a, p);
	}

	/**
	 * Easing equation function for a back (overshooting cubic easing: (s+1)*t^3
	 * - s*t^2) easing in: accelerating from zero velocity.
	 * 
	 * @param t
	 *            Current time (in frames or seconds).
	 * @param s
	 *            Overshoot ammount: higher s means greater overshoot (0
	 *            produces cubic easing with no overshoot, and the default value
	 *            of 1.70158 produces an overshoot of 10 percent).
	 * @return The correct value.
	 */
	static double easeInBack(double t) {
		double s = 1.70158;
		return t * t * ((s + 1.0) * t - s);
	}

	static double easeInBack(double t, double s) {

		return t * t * ((s + 1.0) * t - s);
	}

	/**
	 * Easing equation function for a back (overshooting cubic easing: (s+1)*t^3
	 * - s*t^2) easing out: decelerating from zero velocity.
	 * 
	 * @param t
	 *            Current time (in frames or seconds).
	 * @param s
	 *            Overshoot ammount: higher s means greater overshoot (0
	 *            produces cubic easing with no overshoot, and the default value
	 *            of 1.70158 produces an overshoot of 10 percent).
	 * @return The correct value.
	 */
	static double easeOutBack(double t) {
		double s = 1.70158;
		t -= 1.0;
		return t * t * ((s + 1.0) * t + s) + 1.0;
	}

	static double easeOutBack(double t, double s) {

		t -= 1.0;
		return t * t * ((s + 1.0) * t + s) + 1.0;
	}

	/**
	 * Easing equation function for a back (overshooting cubic easing: (s+1)*t^3
	 * - s*t^2) easing in/out: acceleration until halfway, then deceleration.
	 * 
	 * @param t
	 *            Current time (in frames or seconds).
	 * @param s
	 *            Overshoot ammount: higher s means greater overshoot (0
	 *            produces cubic easing with no overshoot, and the default value
	 *            of 1.70158 produces an overshoot of 10 percent).
	 * @return The correct value.
	 */
	static double easeInOutBack(double t) {
		double s = 1.70158;
		t *= 2.0;
		if (t < 1.0) {
			s *= (1.525);
			return 0.5 * (t * t * ((s + 1.0) * t - s));
		} else {
			t -= 2.0;
			s *= (1.525);
			return 0.5 * (t * t * ((s + 1.0) * t + s) + 2.0);
		}
	}

	/**
	 * Easing equation function for a back (overshooting cubic easing: (s+1)*t^3
	 * - s*t^2) easing out/in: deceleration until halfway, then acceleration.
	 * 
	 * @param t
	 *            Current time (in frames or seconds).
	 * @param s
	 *            Overshoot ammount: higher s means greater overshoot (0
	 *            produces cubic easing with no overshoot, and the default value
	 *            of 1.70158 produces an overshoot of 10 percent).
	 * @return The correct value.
	 */
	static double easeOutInBack(double t) {
		double s = 1.70158;
		if (t < 0.5)
			return easeOutBack(2.0 * t, s) / 2.0;
		return easeInBack(2.0 * t - 1.0, s) / 2.0 + 0.5;
	}

	static double easeOutBounce_helper(double t, double c, double a) {
		if (t == 1.0)
			return c;
		if (t < (4.0 / 11.0)) {
			return c * (7.5625 * t * t);
		} else if (t < (8.0 / 11.0)) {
			t -= (6.0 / 11.0);
			return -a * (1.0 - (7.5625 * t * t + 0.75)) + c;
		} else if (t < (10.0 / 11.0)) {
			t -= (9.0 / 11.0);
			return -a * (1.0 - (7.5625 * t * t + 0.9375)) + c;
		} else {
			t -= (21.0 / 22.0);
			return -a * (1.0 - (7.5625 * t * t + 0.984375)) + c;
		}
	}

	/**
	 * Easing equation function for a bounce (exponentially decaying parabolic
	 * bounce) easing out: decelerating from zero velocity.
	 * 
	 * @param t
	 *            Current time (in frames or seconds).
	 * @param a
	 *            Amplitude.
	 * @return The correct value.
	 */
	static double easeOutBounce(double t, double a) {
		return easeOutBounce_helper(t, 1.0, a);
	}

	static double easeOutBounce(double t) {
		double a = 1.0;
		return easeOutBounce_helper(t, 1.0, a);
	}

	/**
	 * Easing equation function for a bounce (exponentially decaying parabolic
	 * bounce) easing in: accelerating from zero velocity.
	 * 
	 * @param t
	 *            Current time (in frames or seconds).
	 * @param a
	 *            Amplitude.
	 * @return The correct value.
	 */
	static double easeInBounce(double t, double a) {
		return 1.0 - easeOutBounce_helper(1.0 - t, 1.0, a);
	}

	static double easeInBounce(double t) {
		double a = 1.0;
		return 1.0 - easeOutBounce_helper(1.0 - t, 1.0, a);
	}

	/**
	 * Easing equation function for a bounce (exponentially decaying parabolic
	 * bounce) easing in/out: acceleration until halfway, then deceleration.
	 * 
	 * @param t
	 *            Current time (in frames or seconds).
	 * @param a
	 *            Amplitude.
	 * @return The correct value.
	 */
	static double easeInOutBounce(double t, double a) {
		if (t < 0.5)
			return easeInBounce(2.0 * t, a) / 2.0;
		else
			return (t == 1.0) ? 1.0
					: easeOutBounce(2.0 * t - 1.0, a) / 2.0 + 0.5;
	}

	static double easeInOutBounce(double t) {
		double a = 1.0;
		if (t < 0.5)
			return easeInBounce(2.0 * t, a) / 2.0;
		else
			return (t == 1.0) ? 1.0
					: easeOutBounce(2.0 * t - 1.0, a) / 2.0 + 0.5;
	}

	/**
	 * Easing equation function for a bounce (exponentially decaying parabolic
	 * bounce) easing out/in: deceleration until halfway, then acceleration.
	 * 
	 * @param t
	 *            Current time (in frames or seconds).
	 * @param a
	 *            Amplitude.
	 * @return The correct value.
	 */
	static double easeOutInBounce(double t) {
		double a = 1.0;
		if (t < (0.5))
			return easeOutBounce_helper((t * 2.0), 0.5, a);
		return (1.0) - easeOutBounce_helper((2.0 - 2.0 * t), 0.5, a);
	}

	static double qt_sinProgress(double value) {
		return Math.sin((value * Math.PI) - M_PI_2) / (2.0) + (0.5);
	}

	static double qt_smoothBeginEndMixFactor(double value) {
		return Math.min(Math.max((1.0) - value * (2.0) + (0.3), (0.0)), (1.0));
	}

	// SmoothBegin blends Smooth and Linear Interpolation.
	// Progress 0 - 0.3 : Smooth only
	// Progress 0.3 - ~ 0.5 : Mix of Smooth and Linear
	// Progress ~ 0.5 - 1 : Linear only

	/**
	 * Easing function that starts growing slowly, then increases in speed. At
	 * the end of the curve the speed will be finalant.
	 */
	static double easeInCurve(double t) {
		final double sinProgress = qt_sinProgress(t);
		final double mix = qt_smoothBeginEndMixFactor(t);
		return sinProgress * mix + t * ((1.0) - mix);
	}

	/**
	 * Easing function that starts growing steadily, then ends slowly. The speed
	 * will be finalant at the beginning of the curve.
	 */
	static double easeOutCurve(double t) {
		final double sinProgress = qt_sinProgress(t);
		final double mix = qt_smoothBeginEndMixFactor((1.0) - t);
		return sinProgress * mix + t * ((1.0) - mix);
	}

	/**
	 * Easing function where the value grows sinusoidally. Note that the
	 * calculated end value will be 0 rather than 1.
	 */
	static double easeSineCurve(double t) {
		return (Math.sin(((t * (Math.PI * 2.0))) - M_PI_2) + (1.0)) / (2.0);
	}

	/**
	 * Easing function where the value grows cosinusoidally. Note that the
	 * calculated start value will be 0.5 and the end value will be 0.5 contrary
	 * to the usual 0 to 1 easing curve.
	 */
	static double easeCosineCurve(double t) {
		return (Math.cos(((t * (Math.PI * 2.0))) - (M_PI_2)) + (1.0)) / (2.0);
	}

	static double easeInOutCubic(double t) {
		t *= 2.0;
		if (t < 1.0) {
			return 0.5 * t * t * t;
		} else {
			t -= 2.0;
			return 0.5 * (t * t * t + 2.0);
		}
	}

	static double easeNone(double progress) {
		return progress;
	}

	public static double StepValue(double step, double len, ECurveType curveType) {

		double x = step / len;
		switch (curveType) {
		case InQuad:
			return easeInQuad(x);
		case OutQuad:
			return easeOutQuad(x);
		case InOutQuad:
			return easeInOutQuad(x);
		case OutInQuad:
			return easeOutInQuad(x);
		case InCubic:
			return easeInCubic(x);
		case OutCubic:
			return easeOutCubic(x);
		case InOutCubic:
			return easeInOutCubic(x);
		case OutInCubic:
			return easeOutInCubic(x);
		case InQuart:
			return easeInQuart(x);
		case OutQuart:
			return easeOutQuart(x);
		case InOutQuart:
			return easeInOutQuart(x);
		case OutInQuart:
			return easeOutInQuart(x);
		case InQuint:
			return easeInQuint(x);
		case OutQuint:
			return easeOutQuint(x);
		case InOutQuint:
			return easeInOutQuint(x);
		case OutInQuint:
			return easeOutInQuint(x);
		case InSine:
			return easeInSine(x);
		case OutSine:
			return easeOutSine(x);
		case InOutSine:
			return easeInOutSine(x);
		case OutInSine:
			return easeOutInSine(x);
		case InExpo:
			return easeInExpo(x);
		case OutExpo:
			return easeOutExpo(x);
		case InOutExpo:
			return easeInOutExpo(x);
		case OutInExpo:
			return easeOutInExpo(x);
		case InCirc:
			return easeInCirc(x);
		case OutCirc:
			return easeOutCirc(x);
		case InOutCirc:
			return easeInOutCirc(x);
		case OutInCirc:
			return easeOutInCirc(x);
		case InElastic:
			return easeInElastic(x);
		case OutElastic:
			return easeOutElastic(x);
		case InOutElastic:
			return easeInOutElastic(x);
		case OutInElastic:
			return easeOutInElastic(x);
		case InBack:
			return easeInBack(x);
		case OutBack:
			return easeOutBack(x);
		case InOutBack:
			return easeInOutBack(x);
		case OutInBack:
			return easeOutInBack(x);
		case OutBounce:
			return easeOutBounce(x);
		case InBounce:
			return easeInBounce(x);
		case InOutBounce:
			return easeInOutBounce(x);
		case OutInBounce:
			return easeOutInBounce(x);
		case InCurve:
			return easeInCurve(x);
		case OutCurve:
			return easeOutCurve(x);
		case SineCurve:
			return easeSineCurve(x);
		case CosineCurve:
			return easeCosineCurve(x);
		default:
			return easeNone(x); // default to Linear;
		}
	}
}
